-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use patch instead of update to replace sidecars with nop image #9128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Use patch instead of update to replace sidecars with nop image #9128
Conversation
|
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
934d222 to
434ad9a
Compare
|
/retest |
|
@prad9192 you will need to rebase against main branch. The e2e failure are fixed in the latest main commits. |
|
/label kind/bug |
|
@prad9192: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/retest |
|
/kind bug |
afrittoli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix, it's much appreciated!
Could you add some testing for the new functionality? It should be possible to simulate the situation you described in the PR description of the pod being updated.
What
Changed StopSidecars() to use Patch() instead of Update() when stopping sidecar containers by replacing their images with the nop image.
Why
The original implementation used Update(), which requires an exact resourceVersion match. This causes 409 conflicts when the kubelet updates the pod status between our GET and UPDATE calls (which happens frequently as containers terminate).
This causes the below errors on the pod.
And the task runs fail with TaskRunResolutionFailed
Even though the task succeeded and sidecars eventually stop, the TaskRun gets marked as failed due to this race condition.
The fix uses JSON Patch (same pattern as UpdateReady() and CancelPod() in this file), which only patches the specific container image fields
Release Notes
Does this PR introduce a user-facing change?